package fr.irit.etracetool.eobjectgraph;
import java.util.HashSet;
import java.util.Set;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;


public class Node {

	private EObject element;
	private Set<Node> successor;
	
	public Node(EObject e) {
		element = e;
		successor = new HashSet<Node>();
	}

	public EObject getElement() {
		return element;
	}
	
	public boolean equals(Node n) {
		return EcoreUtil.equals(element, n.getElement());
	}

	public void addSucc(Node n) {
		if (!BipartiteGraph.contains(getSuccessor(), n.getElement())) {
			this.successor.add(n);
		}
	}

	public Set<Node> getSuccessor() {
		return successor;
	}

}
